package com.huawei.spare.part.replace.models;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.google.common.collect.Lists;
import com.huawei.spare.part.replace.models.constants.Plane;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;


/**
 * 单板配套软件包信息
 */
@Setter
@ToString
public class SwitchMatchedPackage implements Serializable {

    @Getter
    @Excel(name = "单板类型", isImportField = "true")
    private String boardTypes;

    @Getter
    @Excel(name = "交换软件版本", isImportField = "true")
    private String softwareVersion;

    @Getter
    @Excel(name = "CPLD版本", isImportField = "true")
    private String cpldVersion;

    @Getter
    @Excel(name = "BMC版本", isImportField = "true")
    private String bmcVersion;

    @Getter
    @Excel(name = "是否可下载", isImportField = "true", replace = { "Yes_true", "No_false" })
    private Boolean downloadable;

    @Getter
    @Excel(name = "V5版本", isImportField = "true", replace = { "Yes_true", "No_false" })
    private Boolean isV5;


    public List<String> getBoardTypeList() {
        if (StringUtils.isNoneBlank(boardTypes)) {
            return Lists.newArrayList(boardTypes.split("&"));
        }
        return Lists.newArrayList();
    }


}
